<template>
  <div>
    <el-card>
      <!-- 列表数据 -->
      <el-table :data="rightsList" style="width: 100%" border>
        <el-table-column type='index' label="ID"> </el-table-column>
        <el-table-column prop="authName" label="权限名称"></el-table-column>
        <el-table-column prop="path" label="路径"> </el-table-column>
        <el-table-column label="权限等级">
          <template slot-scope="scope">
            <el-button
              size="mini"
              type="primary"
              v-if="scope.row.level == '0'"
              plain
              >一级</el-button
            >
            <el-button
              size="mini"
              type="success"
              v-if="scope.row.level == '1'"
              plain
              >二级</el-button
            >
            <el-button
              size="mini"
              type="danger"
              v-if="scope.row.level == '2'"
              plain
              >三级</el-button
            >
          </template>
        </el-table-column>
      </el-table>
    </el-card>
  </div>
</template>
<script>
// 获取权限角色
import {rights} from '@/axios/https'
export default {
  name: "",
  components: {},
  props: [],
  data() {
    return {
      rightsList: [],
    };
  },
  computed: {},
  watch: {},
  created() {},
  mounted() {
    this.getList();
  },
  methods: {
    async getList() {
      const {data:res}=await rights("/rights/list")
      if(res.meta.status !== 200) return 
      this.rightsList = res.data;
    },
    
  },
};
</script>
<style scoped>
</style>